package com.cypher.encryptionanddecryption.bluetooth;

import android.app.Activity;

/**
 * 存放蓝牙工具管理类的单例类
 * @author: 古霸天
 * @date: 2020/11/5
 */
public class BluetoothManagerSingleton {
    private static BluetoothManagerSingleton bluetoothManagerSingleton = null;

    private BluetoothUtilManager bluetoothUtilManager;
    public BluetoothUtilManager getBluetoothUtilManager() {
        return bluetoothUtilManager;
    }

    public void setBluetoothUtilManager(BluetoothUtilManager bluetoothUtilManager) {
        this.bluetoothUtilManager = bluetoothUtilManager;
    }

    private BluetoothGattManager bluetoothGattManager;
    public BluetoothGattManager getBluetoothGattManager() {
        return bluetoothGattManager;
    }
    public void setBluetoothGattManager(BluetoothGattManager bluetoothGattManager) {
        this.bluetoothGattManager = bluetoothGattManager;
    }

    private Activity activity;
    public Activity getActivity() {
        return activity;
    }
    public void setActivity(Activity activity) {
        this.activity = activity;
    }

    private BluetoothManagerSingleton() {

    }

    public static BluetoothManagerSingleton getInstance() {
        if(bluetoothManagerSingleton == null) {
            bluetoothManagerSingleton = new BluetoothManagerSingleton();
        }
        return bluetoothManagerSingleton;
    }

    /**
     * 释放资源
     */
    public void releaseResource() {
        bluetoothUtilManager = null;
        bluetoothGattManager = null;
        bluetoothManagerSingleton = null;

    }
}
